﻿<UserControl x:Class="QUT.Bio.SilverMap.DefaultProvider.Loader"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:util="clr-namespace:QUT.Bio.Util"
			 xmlns:smb="clr-namespace:QUT.Bio.SilverMap"
			 xmlns:tk="clr-namespace:System.Windows;assembly=System.Windows.Controls.Toolkit">
	<Grid x:Name="LayoutRoot"
		  Background="White">
		<Grid.RowDefinitions>
			<RowDefinition x:Name="r0"
						   Height="auto" />
			<RowDefinition x:Name="r1"
						   Height="3" />
			<RowDefinition x:Name="r2"
						   Height="auto" />
			<RowDefinition x:Name="r3"
						   Height="3" />
			<RowDefinition x:Name="r4"
						   Height="*" />
			<RowDefinition x:Name="r5"
						   Height="3" />
			<RowDefinition x:Name="r6"
						   Height="auto" />
			<RowDefinition x:Name="r7"
						   Height="3" />
			<RowDefinition x:Name="r8"
						   Height="auto" />
		</Grid.RowDefinitions>

		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="auto" />
			<ColumnDefinition Width="auto" />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>

		<!-- Query gene: -->
		<TextBlock Grid.Column="0"
				   Grid.Row="0"
				   Margin="0 2 5 0"
				   Text="Query gene:"
				   HorizontalAlignment="Right" />

		<!-- Query gene search -->
		<Grid Name="queryGeneSearchHolder"
			  Grid.Column="2"
			  Grid.Row="0">
			<Grid.RowDefinitions>
				<RowDefinition Height="auto" />
				<RowDefinition Height="auto" />
				<RowDefinition Height="3" />
				<RowDefinition Height="auto" />
				<RowDefinition Height="3" />
				<RowDefinition Height="auto" />
				<RowDefinition Height="3" />
				<RowDefinition Height="auto" />
			</Grid.RowDefinitions>

			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="auto" />
				<ColumnDefinition Width="5" />
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="5" />
				<ColumnDefinition Width="auto" />
			</Grid.ColumnDefinitions>

			<!-- from genome -->
			<TextBlock Grid.Column="0"
					   Grid.Row="0"
					   Margin="0 2 5 0"
					   Text="from genome"
					   HorizontalAlignment="Right" />

			<!-- List of query genomes -->
			<util:WatermarkedTextBox x:Name="querySequenceField"
									 Watermark="Sequences to search for hit genes. Click [+/-] to add or change."
									 HorizontalAlignment="Stretch"
									 Grid.Row="0"
									 Grid.Column="2"
									 IsReadOnly="True" />

			<!-- edit query genomes -->
			<Button Name="editQuerySequenceButton"
					Grid.Row="0"
					Grid.Column="4"
					Content="+/-"
					Click="EditSequenceButtonClicked" />

			<!-- with text -->
			<TextBlock Grid.Column="0"
					   Grid.Row="1"
					   Margin="0 2 5 0"
					   Text="with text"
					   HorizontalAlignment="Right" />

			<!-- query string -->
			<util:WatermarkedTextBox x:Name="searchTextField"
									 Watermark="Enter one or more search terms, * for 'everything'"
									 Grid.Column="2"
									 Grid.Row="1" />

			<!-- max genes label -->
			<TextBlock Text="Maximum genes"
					   Grid.Row="3"
					   Grid.Column="0" />

			<!-- maximum number of genes -->
			<TextBox Name="maxGenesField"
					 Grid.Column="2"
					 Grid.Row="3"
					 Width="100" />

			<!-- and/or -->
			<StackPanel	Name="tagOperatorPanel"
						Orientation="Horizontal"
						Grid.Row="5"
						Grid.Column="2"
						HorizontalAlignment="Left"
						Visibility="Collapsed">

				<RadioButton Name="andTagsButton"
							 Content="And"
							 Grid.Row="1"
							 Grid.Column="0"
							 GroupName="AndOrTags" />

				<RadioButton Name="orTagsButton"
							 Content="Or"
							 Grid.Row="1"
							 Grid.Column="1"
							 GroupName="AndOrTags"
							 Margin="5 0 0 0"
							 IsChecked="True" />

			</StackPanel>

			<!-- having tags -->
			<TextBlock Name="tagTitle"
					   Grid.Column="0"
					   Grid.Row="7"
					   Margin="0 2 5 0"
					   Text="having tags"
					   HorizontalAlignment="Right"
					   Visibility="Collapsed" />

			<!-- list of tags -->
			<util:WatermarkedTextBox x:Name="tagField"
									 Watermark="Use tags to further extend or restrict search. Click [+/-] to add or change."
									 Grid.Row="7"
									 Grid.Column="2"
									 IsReadOnly="True"
									 Visibility="Collapsed" />

			<!-- tag edit button -->
			<Button Name="editTagsButton"
					Content="+/-"
					Grid.Row="7"
					Grid.Column="4"
					Click="EditTagsButtonClicked"
					Visibility="Collapsed" />
		</Grid>

		<!-- search button -->
		<Button x:Name="searchButton"
				Grid.Column="2"
				Grid.Row="2"
				Content="Search"
				Click="searchButton_Click"
				VerticalAlignment="Center"
				HorizontalAlignment="Center" />

		<!-- query gene picker -->
		<util:DataGrid x:Name="queryGeneDataGrid"
					   Grid.Column="1"
					   Grid.Row="4"
					   Grid.ColumnSpan="2"
					   AutoGenerateColumns="False"
					   AlternatingRowBackground="White"
					   RowBackground="White"
					   GridLinesVisibility="None"
					   HorizontalAlignment="Stretch"
					   SelectionMode="Single">
			<util:DataGrid.Columns>
				<!--
				<util:DataGridTextColumn Header="Id"
									   Binding="{Binding Id}"
									   CanUserReorder="True" /> 
				-->
				<util:DataGridTextColumn Header="Name"
										 Binding="{Binding Name}"
										 CanUserReorder="True"
										 IsReadOnly="True" />

				<util:DataGridTextColumn Header="GI"
										 Binding="{Binding GI}"
										 CanUserReorder="True"
										 IsReadOnly="True" />

				<util:DataGridTextColumn Header="Symbol"
										 Binding="{Binding Symbol}"
										 CanUserReorder="True"
										 IsReadOnly="True" />

				<util:DataGridTextColumn Header="Product"
										 Binding="{Binding Product}"
										 CanUserReorder="True"
										 IsReadOnly="True" />
			</util:DataGrid.Columns>
		</util:DataGrid>

		<!-- Hit genomes -->
		<TextBlock Grid.Column="0"
				   Grid.Row="6"
				   Margin="0 2 5 0"
				   Text="Hit genomes:"
				   HorizontalAlignment="Right" />

		<!-- Hit genome chooser -->
		<Grid Grid.Column="2"
			  Grid.Row="6">

			<Grid.RowDefinitions>
				<RowDefinition Height="auto" />
			</Grid.RowDefinitions>

			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="*" />
				<ColumnDefinition Width="5" />
				<ColumnDefinition Width="auto" />
			</Grid.ColumnDefinitions>

			<!-- List of query genomes -->
			<util:WatermarkedTextBox x:Name="hitSequenceField"
									 Watermark="Sequences to search for hit genes. Click [+/-] to add or change."
									 HorizontalAlignment="Stretch"
									 Grid.Row="0"
									 Grid.Column="0"
									 IsReadOnly="True" />

			<!-- edit query genomes -->
			<Button Name="editHitSequenceButton"
					Grid.Row="0"
					Grid.Column="2"
					Content="+/-"
					Click="EditSequenceButtonClicked" />

		</Grid>

		<StackPanel Orientation="Horizontal"
					Grid.Row="8"
					Grid.Column="1"
					Grid.ColumnSpan="2"
					HorizontalAlignment="Center">

			<TextBlock Margin="0 2 5 0"
					   Text="Distance"
					   HorizontalAlignment="Right" />

			<ComboBox x:Name="distanceChoiceField"
					  Grid.Column="1"
					  Grid.Row="6" />

			<TextBlock Text="Threshold"
					   Margin="15 2 5 2" />

			<TextBox x:Name="thresholdTextField"
					 Text="1"
					 Width="75"
					 MaxLength="10"
					 HorizontalAlignment="Left" />

			<TextBlock Text="Max hits"
					   Margin="15 2 5 2" />

			<TextBox x:Name="maxHitsTextField"
					 Text="100"
					 Width="75"
					 MaxLength="10"
					 HorizontalAlignment="Left" />
		</StackPanel>

	</Grid>
</UserControl>
